/** @format */

import { ref, watch } from 'vue'
const theSchemaValue = ref()
// 按照惯例，组合式函数名以“use”开头
export function useForm() {
  const setSchemaValue = (value: any) => {
    theSchemaValue.value = {
      ...theSchemaValue.value,
      ...value,
    }
    // onChangeValue()
  }
  const getSchemaValue = () => {
    return theSchemaValue.value
  }
  // 通过返回值暴露响应式变量、方法
  return {
    theSchemaValue,
    setSchemaValue,
    getSchemaValue,
  }
}
